﻿using System.Xml;

namespace Jayden.Dll.Sc2.Descriptions
{
	public class ResearchActionDescription: BuildActionDescription
	{
		protected ResearchActionDescription(EntityDescription entity, EntityDescription build, string id)
			: base(entity, build, id) { }
		public ResearchActionDescription(EntityDescription entity, XmlNode node, string format = "{0}Research{1}", string nameFormat = "{0} research {1}")
			: base(entity, node, format, nameFormat) { }

		public override bool IsAccessible(GameState state)
		{
			GameState.EntityState entity = state[Build];
			if (entity != null && entity.Total > 0)
				return false;
			return base.IsAccessible(state);
		}
	}
}
